The invention relates generally to data encoding and transmission and, more specifically, to a method and apparatus for generating and delivering encoded data between a stylus and a host computer system.
Many computer systems now make use of an input device known as a stylus. A stylus is a pointing device which an operator can utilize to indicate a specific location, such as a position on a CRT screen, LCD screen, or a graphics tablet, to a host computer system. A stylus can be used, for example, to select one of a number of options being displayed on a computer monitor or to input handwritten data into a computer. In this regard, a stylus must have some way of indicating its position to a host computer system.
In addition to position information, a stylus should be capable of transferring other types of data, known as telemetry data, to a host computer. Telemetry data can be very important in the performance of applications by a host computer system. For example, one type of telemetry data which may be transferred from a stylus to a host computer is tip switch position. As its name implies, a tip switch is an electrical switch coupled to the tip of a stylus. When the stylus tip touches a surface, such as a CRT screen, the tip switch may open or close, depending on how the switch is configured. The host computer can use this tip switch position information, in conjunction with the stylus position information, to perform any number of different applications. For example, in an application where a user selects an option from a computer display, the host computer can compute the stylus position at the instant when the tip switch changed position to determine which option on the computer display was selected. As is apparent, it is very important that the telemetry data be accurately transferred from the stylus to the host computer so that mistakes are not made in the performance of applications.
A need therefore exists for a method and apparatus for accurately delivering telemetry data from a stylus to a host computer.
The invention provides a method and apparatus for accurately delivering telemetry data from a stylus to a host computer via a serial, asynchronous data channel. The telemetry data may include, for example, tip switch position, barrel switch position, battery condition, stylus identification, tip switch pressure, and any other information the host computer may need from the stylus to perform a particular application. Within the stylus, the telemetry data is encoded into code-words using a specially selected error detecting or error correcting code. The code-words are then transmitted from the stylus to the host computer in a continuous, homogeneous data stream without the use of framing delimiters between successive code-words. The continuous, homogeneous data stream is received by the host computer which separates the code-words according to the unique characteristics of the selected code. The code-words may then be decoded and used by the host computer in the performance of applications.
The lack of framing delimiters in the continuous, homogeneous data stream is important in systems which perform integration on the data stream when received in the host computer. This is because the integration function generally requires a DC balanced signal and framing delimiters tend to destroy DC balance. For example, one type of framing delimiter commonly used is a relatively long interval of idle time between data packets. This period of idle time can greatly affect the DC balance of the transmitted data stream and is therefore undesirable. The lack of framing delimiters, however, creates problems in accurately separating validly transmitted code-words once the data stream is received by the host computer. This is because noise, or the code-words themselves, may result in bit strings in the data stream, known as invalid intermediate matches, which match valid code-words but which are not actual code-words validly transmitted from the stylus. If the host computer recognizes these invalid intermediate matches as validly transmitted code-words, serious complications may arise in the performance of applications. Therefore, in one embodiment, the invention provides a synchronization scheme which greatly reduces the probability that invalid intermediate code matches in the continuous data stream will be recognized in the host computer as valid code-words.
In choosing a code in accordance with the present invention, one concern is that the code contain a level of redundancy sufficient to detect or correct most of the errors which will occur in the system. Another concern is that the code have zero, or a relatively low, probability of creating invalid intermediate code matches between back-to-back code-words. Using these two criteria, a code can be selected which provides a very low incidence of invalid intermediate matches being detected in the host computer. In the preferred embodiment of the present invention, each code-word is 21 bits long and includes a 10-bit data portion, containing the telemetry data, and an 11-bit code portion. To create the 21-bit code-word, the 10-bit data portion is first encoded using a shortened (23,12) Golay code. The resulting bit string is then appended to the end of the 10-bit data portion to create a 21-bit word. The 11-bit Golay coded portion of the word is then inverted in every bit position except the second to last to create the 21-bit code-word.
Before the code-words are transmitted from the stylus, they may be subjected to further coding, such as run-length-limited (RLL) coding, to ensure that the transmitted signal contains enough timing information for effective synchronization within the host computer. This additional coding can also provide DC balance to the transmitted signal, which, as described above, is important when receiving circuitry is used which performs mathematical integration on the received signal. In the preferred embodiment, Manchester encoding is used to provide both timing information and DC balance to the transmitted signal.
Transmission of the code-words from the stylus to the host computer may be by any known method of data transmission. In the preferred embodiment of the present invention, the code-words are used to modulate an RF signal in the stylus and are then delivered to the host computer, at least in part, by RF link. Because RF transmission is relatively noisy, systems using this form of transmission greatly benefit from the invention""s ability to reject invalid intermediate matches and to detect or correct errors in the transmitted code-words. It should be understood, however, that other forms of data transmission may also be used with the present invention, such as transmission by electrical wire.
After the continuous stream of code-words is received by the host computer, circuitry internal to the host computer separates the code-words from one another based on the characteristics of the chosen code. In other words, the framing of the code-words is xe2x80x9cimpliedxe2x80x9d in the chosen code. In one embodiment of the present invention, the host computer includes code checking circuitry which monitors the continuous stream of code-words to detect the occurrence of bit strings which match valid code-words. These detected bit strings are then separated by the host computer and treated as code-words validly transmitted from the stylus. This separation scheme produces adequate results if the code being used has no (or an extremely low) probability of creating invalid intermediate matches between back-to-back code-words and the transmission method is not very noisy. However, some codes will have a much higher probability of creating invalid intermediate matches and therefore require additional processing of the continuous stream of code-words before it is determined that validly transmitted code-words have been detected. In addition, any bit errors which occur in the transmission of the continuous stream of code-words to the host computer may increase the occurrence of invalid intermediate matches in the data stream. Therefore, in another embodiment of the present invention, the host computer further includes synchronization circuitry for reducing the probability that an invalid intermediate match in the continuous stream of code-words will be recognized in the host computer as a validly transmitted code-word.
The synchronization circuitry monitors the bit string matches detected by the code checking circuitry. Using this information, the synchronization circuitry qualifies a detected bit string (i.e., treats the bit string as a validly transmitted code-word) only if a predetermined number of code matches occur back-to-back in the input data stream. If this occurs, the synchronization circuitry then instructs the code checking circuitry to check the continuous data stream for code matches only at regular intervals equal to the length of a code-word. In this way, the probability of detecting an invalid intermediate match and treating it as a validly transmitted code-word is greatly reduced.
It should be appreciated that the present invention may be implemented in any data transmission system where data. packets are transmitted back-to-back with no framing delimiters in a relatively noisy channel. Other objects and advantages of the present invention will be apparent from the following description.